package test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test {
	public static void main(String[] args) {
	    //System.out.println("把/替换成//".replaceAll("/","//"));
		Pattern pattern = Pattern.compile("~c");
		Matcher matcher = pattern.matcher("casc.gif");
		while(matcher.find()){
            System.out.println(matcher.group());          
        }

		/*System.out.println("========");
		System.out.print(matcher.find());
		System.out.println(matcher.group());
		System.out.print(matcher.find());
		System.out.println(matcher.group());
		System.out.print(matcher.find());
		System.out.println(matcher.group());
		System.out.print(matcher.find());
		System.out.println(matcher.group());*/
		
	}
}
